<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
        <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>搜索</title>
<style>
  body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    
    margin: 0;
    background: #f4f4f4;
  }

  .search-box {
    position: relative;
  }

  .search-box input[type="text"] {
    width: 300px;
    padding: 10px 50px 10px 20px;
    border: 2px solid #ccc;
    border-radius: 24px;
    outline: none;
    font-size: 16px;
  }

  .search-box input[type="text"]:focus {
    border-color: #66afe9;
    box-shadow: 0 0 8px rgba(102, 175, 233, 0.6);
  }

  .search-box button[type="submit"] {
    position: absolute;
   
    left: 333px;
    width: 70px;
    height: 40px;
    border: none;
    background:black;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
  }

  .search-box button[type="submit"]:hover {
    background: #357ec7;
  }

  /* 添加一个简单的动画效果 */
  @keyframes rotate {
    from {
      transform: rotate(0deg);
    }
    to {
      transform: rotate(360deg);
    }
  }

  .search-box button[type="submit"].loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: rotate 0.6s linear infinite;
  }
  
  <!-- table 表单元素css -->
   table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.9em;
    min-width: 400px;
    border-radius: 5px 5px 0 0;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
  }
  th, td {
    padding: 12px 15px;
    text-align: center;

    border-bottom: 1px solid #dddddd;
  }
  th {
    font-size: 20px;
    background-color: #009879;
    color: #ffffff;
    text-align: center;
  }
  tr {
    background-color: #f3f3f3;
  }
  tr:nth-of-type(even) {
    background-color: #dddddd;
  }
  table button {
  background-color: #4CAF50; /* 按钮颜色 */
  border: none;
  color: white; /* 文字颜色 */
  padding: 9px 20px; /* 内边距 */
  text-align: center; /* 文字居中 */
  text-decoration: none;
  display: inline-block;
  font-size: 16px; /* 字体大小 */
  margin: 4px 2px;
  cursor: pointer;
  border-radius: 16px; /* 圆角边框 */
  transition: background-color 0.3s; /* 过渡效果 */
}
 
table button:hover {
  background-color: #45a049; /* 鼠标悬浮颜色 */
}
a{
	text-decoration: none;
	color :white;
}
#mytableDiv{
		position: relative;
}
h2 a{
	color:black;
	border:0.5px solid grey;
	border-radius: 3px;
	 transition: background-color 0.3s; /* 过渡效果 */
}
h2 a:hover{
		background-color: black;
		color:white;
}
#delete_botton{
	background-color: red;
	 transition: background-color 0.3s; /* 过渡效果 */
}
th{
	background-color: black;
}
#delete_botton:hover{
	background-color: #CC0000;
}
</style>
</head>
<body>
<div id="bigDiv">
<div class="search-box">
  <form action="SousuoChapterServlet" method="get">
    <input type="text" name="query" placeholder="">
    <button type="submit">搜索</button>
  </form>
</div>
<br>
<div id="mytableDiv">
<table id="myTable">
  <tr>
    <th>章节ID</th>
    <th>章节名字</th>
    <th>所属小说Id</th>
    <th>章节更新时间</th>
    
    <th>章节内容</th>
 
    <th>修改</th>
    <th>删除</th>
  </tr>
  <c:forEach items="${pageBean.date }" var="chapter">
			<tr>
				<td>${chapter.chapterId }</td>
				<td>${chapter.chapterName }</td>
				<td>${chapter.novelId }</td>
				
				<td>
					<textarea name="readonly" rows="4" cols="50" readonly style="background-color:#ccc">
					${chapter.chapterContent}
					</textarea>
				</td>
				<td>${chapter.updateTime }</td>
				
				<td><button><a href="chapterUpdate.jsp?chapterId=${chapter.chapterId }&chapterName=${chapter.chapterName }&chapterContent=请求头太大暂不支持修改&updateTime=${chapter.updateTime }">修改</a></button></td>
				<td><button id="delete_botton"><a href="chapterDeleteServlet?chapterId=${chapter.chapterId }">删除</a></button></td>
			</tr>
		</c:forEach>
  </table>
  
  </div>
  </div>
</body>
</html>